package com.java.teacherexer.exer2;

public class MultithreadedTest {


    public static void main(String[] args) {


        for (int i = 0; i < 10; i++) {
            int k = i * 10 + 1;
            Add add = new Add(k);


            add.start();
        }
        try {
            Thread.sleep(30);
        } catch (InterruptedException e) {

            e.printStackTrace();
        }
        System.out.println("10个线程结果相加为：" + Add.sum);
    }


}


